﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SheepCultivation.API.AddliCation.Reportw;
using SheepCultivation.Common.Dto;
using SheepCultivation.Enum;


namespace SheepCultivation.API.Controllers
{
    /// <summary>
    /// 报表控制器
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    
    public class ReportController : ControllerBase
    {
        public readonly IMediator mediator;

        public ReportController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 羊只类型分类
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost("SheepBeedTypeReport")]
        public async Task<Result> Handle(ReportSheepTypeCommon request)
        {
            return await mediator.Send(request);
        }
        
        /// <summary>
        /// 羊只报表查询条件(栋舍)
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>

        [HttpPost("SheepmethodReport")]
        public async Task<Result> Handle(ReportConditionCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 羊只报表查询条件(耳号)
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>

        [HttpPost("SheepEarReport")]
        public async Task<Result> Handle(ReportEarSeachCommon request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 羊只报表查询条件(品种)
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>

        [HttpPost("SheepBeedReport")]
        public async Task<Result> Handle(ReportBeedCommon request)
        {
            return await mediator.Send(request);
        }

        /// <summary>
        /// 羊只实时存栏
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>

        [HttpPost("SheepHerdsReport")]
        public async Task<Result> Handle(ReportSeachCommon request)
        {
           return await mediator.Send(request);
        }
    }
}
